load("//tools:defaults.bzl", "esbuild", "http_server", "ng_module")

package(default_visibility = ["//modules/playground:__subpackages__"])

ng_module(
    name = "routing",
    srcs = glob(["**/*.ts"]),
    assets = glob(
        ["**/*.html"],
        exclude = ["index.html"],
    ),
    tsconfig = "//modules/playground:tsconfig-build.json",
    deps = [
        "//packages/core",
        "//packages/platform-browser",
        "//packages/platform-browser-dynamic",
        "//packages/router",
        "@npm//rxjs",
    ],
)

esbuild(
    name = "bundles",
    entry_point = ":main.ts",
    splitting = True,
    deps = [":routing"],
)

http_server(
    name = "devserver",
    srcs = [
        "css/app.css",
        "css/gumby.css",
        "index.html",
        "//third_party/fonts.google.com/open-sans",
    ],
    deps = [
        ":bundles",
        "//packages/zone.js/bundles:zone.umd.js",
    ],
)
